
fn main() -> miette::Result<()> {
    let path = std::path::PathBuf::from("src"); // include path
    let mut b = autocxx_build::Builder::new("src/lib.rs", &[&path])
        .auto_allowlist(true).build()?;
    // This assumes all your C++ bindings are in main.rs
    b.flag_if_supported("-std=c++20")
        .file("src/rbtree.cpp")
        .compile("autocxx-rbtree"); // arbitrary library name, pick anything
    println!("cargo:rerun-if-changed=src/lib.rs");
    println!("cargo:rerun-if-changed=src/rbtree.h");
    println!("cargo:rerun-if-changed=src/rbtree.cpp");
    // Add instructions to link to any C++ libraries you need.
    Ok(())
}